<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        
        
        
        <link rel="shortcut icon" href="../../img/favicon.ico">
        <title>购物车 - Mall Docs</title>
        <link href="../../css/bootstrap.min.css" rel="stylesheet">
        <link href="../../css/font-awesome.min.css" rel="stylesheet">
        <link href="../../css/base.css" rel="stylesheet">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">

        <script src="../../js/jquery-1.10.2.min.js" defer></script>
        <script src="../../js/bootstrap.min.js" defer></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
        <script>hljs.initHighlightingOnLoad();</script> 
    </head>

    <body>
        <div class="navbar fixed-top navbar-expand-lg navbar-dark bg-primary">
            <div class="container">
                <a class="navbar-brand" href="../..">Mall Docs</a>
                <!-- Expander button -->
                <button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar-collapse">
                    <span class="navbar-toggler-icon"></span>
                </button>

                <!-- Expanded navigation -->
                <div id="navbar-collapse" class="navbar-collapse collapse">
                        <!-- Main navigation -->
                        <ul class="nav navbar-nav">
                            <li class="navitem">
                                <a href="../.." class="nav-link">Home</a>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">User <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    
<li>
    <a href="../../user/user/" class="dropdown-item">Main</a>
</li>
                                </ul>
                            </li>
                            <li class="dropdown active">
                                <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Mall <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    
<li>
    <a href="../" class="dropdown-item">首页</a>
</li>
                                    
<li>
    <a href="../coupon/" class="dropdown-item">优惠券</a>
</li>
                                    
<li>
    <a href="../goods/" class="dropdown-item">产品</a>
</li>
                                    
<li>
    <a href="../search/" class="dropdown-item">搜索</a>
</li>
                                    
<li>
    <a href="./" class="dropdown-item active">购物车</a>
</li>
                                    
<li>
    <a href="../address/" class="dropdown-item">地址</a>
</li>
                                    
<li>
    <a href="../activity/" class="dropdown-item">活动</a>
</li>
                                    
<li>
    <a href="../order/" class="dropdown-item">订单</a>
</li>
                                    
<li>
    <a href="../my/" class="dropdown-item">个人中心</a>
</li>
                                    
<li>
    <a href="../collect/" class="dropdown-item">收藏</a>
</li>
                                    
<li>
    <a href="../aftersale/" class="dropdown-item">售后</a>
</li>
                                    
<li>
    <a href="../vip/" class="dropdown-item">会员</a>
</li>
                                    
<li>
    <a href="../charge/" class="dropdown-item">充值</a>
</li>
                                </ul>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">管理后台 <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    
<li>
    <a href="../../admin/user/" class="dropdown-item">用户</a>
</li>
                                    
<li>
    <a href="../../admin/goods/" class="dropdown-item">商品</a>
</li>
                                    
<li>
    <a href="../../admin/ad/" class="dropdown-item">推广</a>
</li>
                                    
<li>
    <a href="../../admin/topic/" class="dropdown-item">活动</a>
</li>
                                </ul>
                            </li>
                        </ul>

                    <ul class="nav navbar-nav ml-auto">
                        <li class="nav-item">
                            <a href="#" class="nav-link" data-toggle="modal" data-target="#mkdocs_search_modal">
                                <i class="fa fa-search"></i> Search
                            </a>
                        </li>
                            <li class="nav-item">
                                <a rel="prev" href="../search/" class="nav-link">
                                    <i class="fa fa-arrow-left"></i> Previous
                                </a>
                            </li>
                            <li class="nav-item">
                                <a rel="next" href="../address/" class="nav-link">
                                    Next <i class="fa fa-arrow-right"></i>
                                </a>
                            </li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="container">
            <div class="row">
                    <div class="col-md-3"><div class="navbar-light navbar-expand-md bs-sidebar hidden-print affix" role="complementary">
    <div class="navbar-header">
        <button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target="#toc-collapse" title="Table of Contents">
            <span class="fa fa-angle-down"></span>
        </button>
    </div>

    
    <div id="toc-collapse" class="navbar-collapse collapse card bg-secondary">
        <ul class="nav flex-column">
            
            <li class="nav-item" data-level="1"><a href="#_1" class="nav-link">购物车相关接口</a>
              <ul class="nav flex-column">
            <li class="nav-item" data-level="2"><a href="#_2" class="nav-link">修订记录</a>
              <ul class="nav flex-column">
              </ul>
            </li>
            <li class="nav-item" data-level="2"><a href="#_3" class="nav-link">背景</a>
              <ul class="nav flex-column">
              </ul>
            </li>
            <li class="nav-item" data-level="2"><a href="#_4" class="nav-link">产品说明</a>
              <ul class="nav flex-column">
              </ul>
            </li>
            <li class="nav-item" data-level="2"><a href="#_5" class="nav-link">关键流程说明</a>
              <ul class="nav flex-column">
              </ul>
            </li>
            <li class="nav-item" data-level="2"><a href="#_6" class="nav-link">接口说明</a>
              <ul class="nav flex-column">
              </ul>
            </li>
              </ul>
            </li>
        </ul>
    </div>
</div></div>
                    <div class="col-md-9" role="main">

<h1 id="_1">购物车相关接口</h1>
<div class="toc">
<ul>
<li><a href="#_1">购物车相关接口</a><ul>
<li><a href="#_2">修订记录</a></li>
<li><a href="#_3">背景</a></li>
<li><a href="#_4">产品说明</a></li>
<li><a href="#_5">关键流程说明</a></li>
<li><a href="#_6">接口说明</a><ul>
<li><a href="#10">1.0 购物车商品总数</a><ul>
<li><a href="#_7">接口说明</a></li>
<li><a href="#_8">请求说明</a></li>
<li><a href="#_9">输入参数</a></li>
<li><a href="#_10">错误说明</a></li>
<li><a href="#_11">返回实例</a></li>
</ul>
</li>
<li><a href="#11">1.1 商品加入购物车</a><ul>
<li><a href="#_12">接口说明</a></li>
<li><a href="#_13">请求说明</a></li>
<li><a href="#_14">输入参数</a></li>
<li><a href="#_15">错误说明</a></li>
<li><a href="#_16">返回实例</a></li>
</ul>
</li>
<li><a href="#11_1">1.1 商品加入购物车</a><ul>
<li><a href="#_17">接口说明</a></li>
<li><a href="#_18">请求说明</a></li>
<li><a href="#_19">输入参数</a></li>
<li><a href="#_20">错误说明</a></li>
<li><a href="#_21">返回实例</a></li>
</ul>
</li>
<li><a href="#12">1.2 立即购买</a><ul>
<li><a href="#_22">接口说明</a></li>
<li><a href="#_23">请求说明</a></li>
<li><a href="#_24">输入参数</a></li>
<li><a href="#_25">错误说明</a></li>
<li><a href="#_26">返回实例</a></li>
</ul>
</li>
<li><a href="#13">1.3 更新购物车商品信息</a><ul>
<li><a href="#_27">接口说明</a></li>
<li><a href="#_28">请求说明</a></li>
<li><a href="#_29">输入参数</a></li>
<li><a href="#_30">错误说明</a></li>
<li><a href="#_31">返回实例</a></li>
</ul>
</li>
<li><a href="#13_1">1.3 修改勾选状态信息</a><ul>
<li><a href="#_32">接口说明</a></li>
<li><a href="#_33">请求说明</a></li>
<li><a href="#_34">输入参数</a></li>
<li><a href="#_35">错误说明</a></li>
<li><a href="#_36">返回实例</a></li>
</ul>
</li>
<li><a href="#14">1.4 购物车详情</a><ul>
<li><a href="#_37">接口说明</a></li>
<li><a href="#_38">请求说明</a></li>
<li><a href="#_39">输入参数</a></li>
<li><a href="#_40">错误说明</a></li>
<li><a href="#_41">返回实例</a></li>
</ul>
</li>
<li><a href="#15">1.5 删除购物车商品</a><ul>
<li><a href="#_42">接口说明</a></li>
<li><a href="#_43">请求说明</a></li>
<li><a href="#_44">输入参数</a></li>
<li><a href="#_45">错误说明</a></li>
<li><a href="#_46">返回实例</a></li>
</ul>
</li>
<li><a href="#16">1.6 购物车结算</a><ul>
<li><a href="#_47">接口说明</a></li>
<li><a href="#_48">请求说明</a></li>
<li><a href="#_49">输入参数</a></li>
<li><a href="#_50">错误说明</a></li>
<li><a href="#_51">返回实例</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<h2 id="_2">修订记录</h2>
<hr />
<table>
<thead>
<tr>
<th>日期</th>
<th>作者</th>
<th>修订类型</th>
<th>修订内容</th>
<th>版本</th>
</tr>
</thead>
<tbody>
<tr>
<td>2020年07月03日</td>
<td>冷立纲</td>
<td>A</td>
<td>新增设计方案</td>
<td>1.0</td>
</tr>
</tbody>
</table>
<blockquote>
<p>【修订类型：A-新增  M-修改 D-删除】</p>
</blockquote>
<h2 id="_3">背景</h2>
<p>购物车相关接口</p>
<h2 id="_4">产品说明</h2>
<h2 id="_5">关键流程说明</h2>
<h2 id="_6">接口说明</h2>
<h4 id="10">1.0 购物车商品总数</h4>
<h5 id="_7">接口说明</h5>
<p>获取购物车商品总数</p>
<h5 id="_8">请求说明</h5>
<table>
<thead>
<tr>
<th align="left">http 请求方式</th>
<th align="center">get</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">url</td>
<td align="center">/cart/goodscount</td>
</tr>
</tbody>
</table>
<h5 id="_9">输入参数</h5>
<p>无</p>
<h5 id="_10">错误说明</h5>
<h5 id="_11">返回实例</h5>
<pre><code class="json">
   {
    &quot;c&quot;: 0,
    &quot;m&quot;: null,
    &quot;d&quot;: 0  //商品总数
} 

</code></pre>

<h4 id="11">1.1 商品加入购物车</h4>
<h5 id="_12">接口说明</h5>
<p>加入商品到购物车</p>
<h5 id="_13">请求说明</h5>
<table>
<thead>
<tr>
<th align="left">http 请求方式</th>
<th align="center">post</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">url</td>
<td align="center">/cart/add</td>
</tr>
</tbody>
</table>
<h5 id="_14">输入参数</h5>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="center">必选</th>
<th align="left">类型</th>
<th align="left">参数说明</th>
<th align="left">备注</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">productId</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">商品ID</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">number</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">产品数量</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">goodsId</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">产品Id</td>
<td align="left"></td>
</tr>
</tbody>
</table>
<h5 id="_15">错误说明</h5>
<h5 id="_16">返回实例</h5>
<pre><code class="json">
{
    &quot;c&quot;: 0,
    &quot;m&quot;: null,
    &quot;d&quot;: 1  //购物车商品总数
}

</code></pre>

<h4 id="11_1">1.1 商品加入购物车</h4>
<h5 id="_17">接口说明</h5>
<p>加入商品到购物车</p>
<h5 id="_18">请求说明</h5>
<table>
<thead>
<tr>
<th align="left">http 请求方式</th>
<th align="center">post</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">url</td>
<td align="center">/cart/add</td>
</tr>
</tbody>
</table>
<h5 id="_19">输入参数</h5>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="center">必选</th>
<th align="left">类型</th>
<th align="left">参数说明</th>
<th align="left">备注</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">productId</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">商品ID</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">number</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">产品数量</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">goodsId</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">产品Id</td>
<td align="left"></td>
</tr>
</tbody>
</table>
<h5 id="_20">错误说明</h5>
<h5 id="_21">返回实例</h5>
<pre><code class="json">
{
    &quot;c&quot;: 0,
    &quot;m&quot;: null,
    &quot;d&quot;: 1  //购物车商品总数
}

</code></pre>

<h4 id="12">1.2 立即购买</h4>
<h5 id="_22">接口说明</h5>
<p>立即购买</p>
<h5 id="_23">请求说明</h5>
<table>
<thead>
<tr>
<th align="left">http 请求方式</th>
<th align="center">post</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">url</td>
<td align="center">/cart/fastadd</td>
</tr>
</tbody>
</table>
<h5 id="_24">输入参数</h5>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="center">必选</th>
<th align="left">类型</th>
<th align="left">参数说明</th>
<th align="left">备注</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">productId</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">商品ID</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">number</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">产品数量</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">goodsId</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">产品Id</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">addressId</td>
<td align="center">否</td>
<td align="left">int</td>
<td align="left">地址ID</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">couponId</td>
<td align="center">否</td>
<td align="left">int</td>
<td align="left">优惠券ID</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">userCouponId</td>
<td align="center">否</td>
<td align="left">int</td>
<td align="left">用户优惠券ID</td>
<td align="left"></td>
</tr>
</tbody>
</table>
<h5 id="_25">错误说明</h5>
<h5 id="_26">返回实例</h5>
<pre><code class="json">
{
    &quot;c&quot;: 0,
    &quot;m&quot;: null,
    &quot;d&quot;: {
        &quot;addressId&quot;: 3,   //地址ID
        &quot;couponId&quot;: 2, //优惠券ID
        &quot;userCouponId&quot;: 5, //用户优惠券ID
        &quot;cartId&quot;: 0, // 购物车ID
        &quot;grouponRulesId&quot;: 0, //团购规则
        &quot;grouponPrice&quot;: 0, //团购价
        &quot;checkedAddress&quot;: {   //地址的选择
            &quot;id&quot;: 3,  //地址ID
            &quot;name&quot;: &quot;我&quot;, //地址名称
            &quot;userId&quot;: 11445, //用户ID
            &quot;province&quot;: &quot;北京市&quot;, //省
            &quot;city&quot;: &quot;市辖区&quot;, //市
            &quot;county&quot;: &quot;朝阳区&quot;, //朝阳
            &quot;addressDetail&quot;: &quot;211&quot;, //地址详情
            &quot;areaCode&quot;: &quot;110105&quot;, //地址编码
            &quot;postalCode&quot;: null, //邮政编码
            &quot;tel&quot;: &quot;15201008961&quot;, //手机号
            &quot;isDefault&quot;: true, //是否默认
            &quot;addTime&quot;: &quot;2020-06-29 14:46:15&quot;, //创建时间
            &quot;updateTime&quot;: &quot;2020-06-29 14:46:15&quot;, //更新时间
            &quot;deleted&quot;: false //是否已删除
        },
        &quot;availableCouponLength&quot;: 2, //可用优惠券数量
        &quot;goodsTotalPrice&quot;: 237.00, //产品总价格
        &quot;freightPrice&quot;: 0,  //运费
        &quot;couponPrice&quot;: 10.00, //优惠金额
        &quot;orderTotalPrice&quot;: 227.00, //订单总金额
        &quot;actualPrice&quot;: 227.00, //实付金额 
        &quot;checkedGoodsList&quot;: [  //结算商品列表
            {
                &quot;id&quot;: 10,  //ID
                &quot;userId&quot;: 11445, //用户ID
                &quot;goodsId&quot;: 1057036, //产品ID
                &quot;goodsSn&quot;: &quot;1057036&quot;, //产品SN
                &quot;goodsName&quot;: &quot;日式纯色水洗亚麻抱枕&quot;, //产品名称
                &quot;productId&quot;: 71, //商品ID
                &quot;price&quot;: 79.00, //商品价格
                &quot;number&quot;: 3, //商品数量
                &quot;specifications&quot;: [  //规格
                    &quot;标准&quot;
                ],
                &quot;checked&quot;: true, //是否选中
                &quot;picUrl&quot;: &quot;http://yanxuan.nosdn.127.net/8a9ee5ba08929cc9e40b973607d2f633.png&quot;, //缩略图
                &quot;addTime&quot;: &quot;2020-07-03 23:11:14&quot;, //添加时间
                &quot;updateTime&quot;: &quot;2020-07-03 23:35:09&quot;, //更新时间
                &quot;deleted&quot;: false //是否已删除
            }
        ],
    &quot;payTypes&quot;: [  //支付方式列表
            {
                &quot;typeName&quot;: &quot;balance&quot;,
                &quot;comment&quot;: &quot;余额支付&quot;,
                &quot;thumbnail&quot;: null
            },
            {
                &quot;typeName&quot;: &quot;ALIPAYCASH&quot;,
                &quot;comment&quot;: &quot;支付宝支付&quot;,
                &quot;thumbnail&quot;: null
            },
            {
                &quot;typeName&quot;: &quot;WX_APP&quot;,
                &quot;comment&quot;: &quot;微信支付&quot;,
                &quot;thumbnail&quot;: null
            }
        ]   
    }
}
</code></pre>

<h4 id="13">1.3 更新购物车商品信息</h4>
<h5 id="_27">接口说明</h5>
<p>更新购物车内商品信息</p>
<h5 id="_28">请求说明</h5>
<table>
<thead>
<tr>
<th align="left">http 请求方式</th>
<th align="center">post</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">url</td>
<td align="center">/cart/update</td>
</tr>
</tbody>
</table>
<h5 id="_29">输入参数</h5>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="center">必选</th>
<th align="left">类型</th>
<th align="left">参数说明</th>
<th align="left">备注</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">id</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">购物车ID</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">productId</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">商品ID</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">number</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">产品数量</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">goodsId</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">产品Id</td>
<td align="left"></td>
</tr>
</tbody>
</table>
<h5 id="_30">错误说明</h5>
<h5 id="_31">返回实例</h5>
<pre><code class="json">
{
    &quot;c&quot;: 0,
    &quot;m&quot;: null,
    &quot;d&quot;: 1  //购物车ID
}

</code></pre>

<h4 id="13_1">1.3 修改勾选状态信息</h4>
<h5 id="_32">接口说明</h5>
<p>修改购物车勾选状态信息</p>
<h5 id="_33">请求说明</h5>
<table>
<thead>
<tr>
<th align="left">http 请求方式</th>
<th align="center">post</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">url</td>
<td align="center">/cart/checked</td>
</tr>
</tbody>
</table>
<h5 id="_34">输入参数</h5>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="center">必选</th>
<th align="left">类型</th>
<th align="left">参数说明</th>
<th align="left">备注</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">productIds</td>
<td align="center">是</td>
<td align="left">int[]</td>
<td align="left">商品ID数组</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">isChecked</td>
<td align="center">是</td>
<td align="left">int</td>
<td align="left">是否选中</td>
<td align="left">1:选中 0:取消</td>
</tr>
</tbody>
</table>
<h5 id="_35">错误说明</h5>
<h5 id="_36">返回实例</h5>
<pre><code class="json">
{
    &quot;c&quot;: 0,
    &quot;m&quot;: null,
    &quot;d&quot;: {
        &quot;cartList&quot;: [  //购物车列表
            {
                &quot;id&quot;: 11,  //购物车项ID
                &quot;goodsId&quot;: 1057036, //产品ID
                &quot;goodsSn&quot;: &quot;1057036&quot;, //产品SN
                &quot;goodsName&quot;: &quot;日式纯色水洗亚麻抱枕&quot;, //产品名称
                &quot;productId&quot;: 71, //商品ID
                &quot;price&quot;: 79.00, //总价格
                &quot;number&quot;: 3, //数量
                &quot;specifications&quot;: [  //规格
                    &quot;标准&quot;
                ],
                &quot;checked&quot;: true, //是否选中
                &quot;picUrl&quot;: &quot;http://yanxuan.nosdn.127.net/8a9ee5ba08929cc9e40b973607d2f633.png&quot;,  //展示图
                &quot;addTime&quot;: &quot;2020-07-04 09:29:23&quot;, //添加时间
                &quot;updateTime&quot;: &quot;2020-07-04 09:29:23&quot; //更新时间
            }
        ],
        &quot;cartTotal&quot;: {   //统计信息
            &quot;goodsCount&quot;: 3, //商品数量
            &quot;goodsAmount&quot;: 237.00, //总价格
            &quot;checkedGoodsCount&quot;: 3, //选中商品总数量
            &quot;checkedGoodsAmount&quot;: 237.00 //选中商品总价格
        }
    }
}

</code></pre>

<h4 id="14">1.4 购物车详情</h4>
<h5 id="_37">接口说明</h5>
<p>获取购物车详情信息</p>
<h5 id="_38">请求说明</h5>
<table>
<thead>
<tr>
<th align="left">http 请求方式</th>
<th align="center">post</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">url</td>
<td align="center">/cart/index</td>
</tr>
</tbody>
</table>
<h5 id="_39">输入参数</h5>
<p>无</p>
<h5 id="_40">错误说明</h5>
<h5 id="_41">返回实例</h5>
<pre><code class="json">
{
    &quot;c&quot;: 0,
    &quot;m&quot;: null,
    &quot;d&quot;: {
        &quot;cartList&quot;: [  //购物车列表
            {
                &quot;id&quot;: 11,  //购物车项ID
                &quot;goodsId&quot;: 1057036, //产品ID
                &quot;goodsSn&quot;: &quot;1057036&quot;, //产品SN
                &quot;goodsName&quot;: &quot;日式纯色水洗亚麻抱枕&quot;, //产品名称
                &quot;productId&quot;: 71, //商品ID
                &quot;price&quot;: 79.00, //货品单价
                &quot;vipPrice&quot;: 79.00, //会员价
                &quot;number&quot;: 3, //数量
                &quot;specifications&quot;: [  //规格
                    &quot;标准&quot;
                ],
                &quot;checked&quot;: true, //是否选中
                &quot;tags&quot;:[], //标签
                &quot;picUrl&quot;: &quot;http://yanxuan.nosdn.127.net/8a9ee5ba08929cc9e40b973607d2f633.png&quot;,  //展示图
                &quot;addTime&quot;: &quot;2020-07-04 09:29:23&quot;, //添加时间
                &quot;updateTime&quot;: &quot;2020-07-04 09:29:23&quot; //更新时间
            }
        ],
        &quot;cartTotal&quot;: {   //统计信息
            &quot;goodsCount&quot;: 3, //商品数量
            &quot;goodsAmount&quot;: 237.00, //总价格
            &quot;checkedGoodsCount&quot;: 3, //选中商品总数量
            &quot;checkedGoodsAmount&quot;: 237.00 //选中商品总价格
        }
    }
}
</code></pre>

<h4 id="15">1.5 删除购物车商品</h4>
<h5 id="_42">接口说明</h5>
<p>删除购物车商品</p>
<h5 id="_43">请求说明</h5>
<table>
<thead>
<tr>
<th align="left">http 请求方式</th>
<th align="center">post</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">url</td>
<td align="center">/cart/delete</td>
</tr>
</tbody>
</table>
<h5 id="_44">输入参数</h5>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="center">必选</th>
<th align="left">类型</th>
<th align="left">参数说明</th>
<th align="left">备注</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">productIds</td>
<td align="center">是</td>
<td align="left">int[]</td>
<td align="left">商品ID数组</td>
<td align="left"></td>
</tr>
</tbody>
</table>
<h5 id="_45">错误说明</h5>
<h5 id="_46">返回实例</h5>
<pre><code class="json">
{
    &quot;c&quot;: 0,
    &quot;m&quot;: null,
    &quot;d&quot;: {
        &quot;cartList&quot;: [  //购物车列表
            {
                &quot;id&quot;: 11,  //购物车项ID
                &quot;goodsId&quot;: 1057036, //产品ID
                &quot;goodsSn&quot;: &quot;1057036&quot;, //产品SN
                &quot;goodsName&quot;: &quot;日式纯色水洗亚麻抱枕&quot;, //产品名称
                &quot;productId&quot;: 71, //商品ID
                &quot;price&quot;: 79.00, //总价格
                &quot;number&quot;: 3, //数量
                &quot;specifications&quot;: [  //规格
                    &quot;标准&quot;
                ],
                &quot;checked&quot;: true, //是否选中
                &quot;picUrl&quot;: &quot;http://yanxuan.nosdn.127.net/8a9ee5ba08929cc9e40b973607d2f633.png&quot;,  //展示图
                &quot;addTime&quot;: &quot;2020-07-04 09:29:23&quot;, //添加时间
                &quot;updateTime&quot;: &quot;2020-07-04 09:29:23&quot; //更新时间
            }
        ],
        &quot;cartTotal&quot;: {   //统计信息
            &quot;goodsCount&quot;: 3, //商品数量
            &quot;goodsAmount&quot;: 237.00, //总价格
            &quot;checkedGoodsCount&quot;: 3, //选中商品总数量
            &quot;checkedGoodsAmount&quot;: 237.00 //选中商品总价格
        }
    }
}
</code></pre>

<h4 id="16">1.6 购物车结算</h4>
<h5 id="_47">接口说明</h5>
<p>结算购物车商品</p>
<h5 id="_48">请求说明</h5>
<table>
<thead>
<tr>
<th align="left">http 请求方式</th>
<th align="center">post</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">url</td>
<td align="center">/cart/checkout</td>
</tr>
</tbody>
</table>
<h5 id="_49">输入参数</h5>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="center">必选</th>
<th align="left">类型</th>
<th align="left">参数说明</th>
<th align="left">备注</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">cartId</td>
<td align="center">否</td>
<td align="left">int</td>
<td align="left">购物车ID</td>
<td align="left">如果购物车商品ID是空，则下单当前用户所有购物车商品； 如果购物车商品ID非空，则只下单当前购物车商品。</td>
</tr>
<tr>
<td align="left">addressId</td>
<td align="center">否</td>
<td align="left">int</td>
<td align="left">收货地址ID</td>
<td align="left">如果收货地址ID是空，则查询当前用户的默认地址。</td>
</tr>
<tr>
<td align="left">couponId</td>
<td align="center">否</td>
<td align="left">int</td>
<td align="left">优惠券ID</td>
<td align="left">如果优惠券ID是空，则自动选择合适的优惠券。</td>
</tr>
<tr>
<td align="left">userCouponId</td>
<td align="center">否</td>
<td align="left">int</td>
<td align="left">用户选择的优惠券ID</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">grouponRulesId</td>
<td align="center">否</td>
<td align="left">int</td>
<td align="left">团购规则ID</td>
<td align="left"></td>
</tr>
</tbody>
</table>
<h5 id="_50">错误说明</h5>
<h5 id="_51">返回实例</h5>
<pre><code class="json">
{
    &quot;c&quot;: 0,
    &quot;m&quot;: null,
    &quot;d&quot;: {
        &quot;addressId&quot;: 3,   //地址ID
        &quot;couponId&quot;: 2, //优惠券ID
        &quot;userCouponId&quot;: 5, //用户优惠券ID
        &quot;cartId&quot;: 0, // 购物车ID
        &quot;grouponRulesId&quot;: 0, //团购规则
        &quot;grouponPrice&quot;: 0, //团购价
        &quot;checkedAddress&quot;: {   //地址的选择
            &quot;id&quot;: 3,  //地址ID
            &quot;name&quot;: &quot;我&quot;, //地址名称
            &quot;userId&quot;: 11445, //用户ID
            &quot;province&quot;: &quot;北京市&quot;, //省
            &quot;city&quot;: &quot;市辖区&quot;, //市
            &quot;county&quot;: &quot;朝阳区&quot;, //朝阳
            &quot;addressDetail&quot;: &quot;211&quot;, //地址详情
            &quot;areaCode&quot;: &quot;110105&quot;, //地址编码
            &quot;postalCode&quot;: null, //邮政编码
            &quot;tel&quot;: &quot;15201008961&quot;, //手机号
            &quot;isDefault&quot;: true, //是否默认
            &quot;addTime&quot;: &quot;2020-06-29 14:46:15&quot;, //创建时间
            &quot;updateTime&quot;: &quot;2020-06-29 14:46:15&quot;, //更新时间
            &quot;deleted&quot;: false //是否已删除
        },
        &quot;availableCouponLength&quot;: 2, //可用优惠券数量
        &quot;goodsTotalPrice&quot;: 237.00, //产品总价格
        &quot;freightPrice&quot;: 0,  //运费
        &quot;couponPrice&quot;: 10.00, //优惠金额
        &quot;orderTotalPrice&quot;: 227.00, //订单总金额
        &quot;actualPrice&quot;: 227.00, //实付金额 
        &quot;checkedGoodsList&quot;: [  //结算商品列表
            {
                &quot;id&quot;: 10,  //ID
                &quot;userId&quot;: 11445, //用户ID
                &quot;goodsId&quot;: 1057036, //产品ID
                &quot;goodsSn&quot;: &quot;1057036&quot;, //产品SN
                &quot;goodsName&quot;: &quot;日式纯色水洗亚麻抱枕&quot;, //产品名称
                &quot;productId&quot;: 71, //商品ID
                &quot;price&quot;: 79.00, //商品价格
                &quot;number&quot;: 3, //商品数量
                &quot;specifications&quot;: [  //规格
                    &quot;标准&quot;
                ],
                &quot;checked&quot;: true, //是否选中
                &quot;picUrl&quot;: &quot;http://yanxuan.nosdn.127.net/8a9ee5ba08929cc9e40b973607d2f633.png&quot;, //缩略图
                &quot;addTime&quot;: &quot;2020-07-03 23:11:14&quot;, //添加时间
                &quot;updateTime&quot;: &quot;2020-07-03 23:35:09&quot;, //更新时间
                &quot;deleted&quot;: false //是否已删除
            }
        ],
    &quot;payTypes&quot;: [  //支付方式列表
            {
                &quot;typeName&quot;: &quot;balance&quot;,
                &quot;comment&quot;: &quot;余额支付&quot;,
                &quot;thumbnail&quot;: null
            },
            {
                &quot;typeName&quot;: &quot;ALIPAYCASH&quot;,
                &quot;comment&quot;: &quot;支付宝支付&quot;,
                &quot;thumbnail&quot;: null
            },
            {
                &quot;typeName&quot;: &quot;WX_APP&quot;,
                &quot;comment&quot;: &quot;微信支付&quot;,
                &quot;thumbnail&quot;: null
            }
        ],
    &quot;wallet&quot;: {
        &quot;couponCount&quot;: 0, //优惠券
        &quot;redEnvelopCount&quot;: 0, //红包
        &quot;giftCardCount&quot;: 0, //礼品卡
        &quot;money&quot;: 44637.84, //余额
        &quot;userPoints&quot;: 0 //用户积分
        }       
    },
    &quot;vipDiscountAmount&quot;:22.22
}

</code></pre></div>
            </div>
        </div>

        <footer class="col-md-12">
            <hr>
            <p>Documentation built with <a href="https://www.mkdocs.org/">MkDocs</a>.</p>
        </footer>
        <script>
            var base_url = "../..",
                shortcuts = {"help": 191, "next": 78, "previous": 80, "search": 83};
        </script>
        <script src="../../js/base.js" defer></script>
        <script src="../../search/main.js" defer></script>

        <div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="searchModalLabel">Search</h4>
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            </div>
            <div class="modal-body">
                <p>
                    From here you can search these documents. Enter
                    your search terms below.
                </p>
                <form>
                    <div class="form-group">
                        <input type="search" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
                    </div>
                </form>
                <div id="mkdocs-search-results"></div>
            </div>
            <div class="modal-footer">
            </div>
        </div>
    </div>
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="keyboardModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            </div>
            <div class="modal-body">
              <table class="table">
                <thead>
                  <tr>
                    <th style="width: 20%;">Keys</th>
                    <th>Action</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td class="help shortcut"><kbd>?</kbd></td>
                    <td>Open this help</td>
                  </tr>
                  <tr>
                    <td class="next shortcut"><kbd>n</kbd></td>
                    <td>Next page</td>
                  </tr>
                  <tr>
                    <td class="prev shortcut"><kbd>p</kbd></td>
                    <td>Previous page</td>
                  </tr>
                  <tr>
                    <td class="search shortcut"><kbd>s</kbd></td>
                    <td>Search</td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="modal-footer">
            </div>
        </div>
    </div>
</div>

    </body>
</html>
